package com.cloud.type.file;

public enum FileType {

    FOLDER("folder","文件夹"),
    MP4("mp4","视频"),
    JPG("jpg","图片"),
    JPEG("jpeg","图片"),
    GIF("gif","动图"),
    PNG("png","图片"),
    HTML("html","html页面"),
    PDF("pdf","文档"),
    DOC("doc","文档"),
    DOCX("docx","文档"),
    PPT("ppt","ppt"),
    PPTX("PPTX","PPTX"),
    ZIP("zip","压缩文件"),
    SQL("sql","sql语句"),
    TXT("txt","文本"),
    FLV("flv","视频"),
    AVI("avi","视频"),
    XLS("xls","excel文件"),
    XLSX("xlsx","excel文件");

    private String code;
    private String desc;

    FileType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static FileType toEnum(String code) {
        for (FileType category : FileType.values()) {
            if (category.getCode().equals(code)) {
                return category;
            }
        }
        return null;
    }



    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
